﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Wusong.Gold.DataService
{
    public interface IResourceBase
    {
        GoldMsg Formart(string textValue);
        string DataUri { get; }
    }

    public partial class GoldMsg
    {
        /// <summary>
        /// 消息读取时间
        /// </summary>
        public DateTime MsgTime { get; set; }

        /// <summary>
        /// 中间价
        /// </summary>
        public double MidPrice
        {
            get;
            set;
        }

        /// <summary>
        /// 买入价
        /// </summary>
        public double SalePrice
        {
            get;
            set;
        }

        /// <summary>
        /// 卖出价
        /// </summary>
        public double BuyPrice
        {
            get;
            set;
        }

        /// <summary>
        /// 美元价
        /// </summary>
        public double DollarPrice
        {
            get;
            set;
        }

        /// <summary>
        /// 美元指数
        /// </summary>
        public double DollarIndex
        {
            get;
            set;
        }

        /// <summary>
        /// 原油指数
        /// </summary>
        public double OilIndex
        {
            get;
            set;
        }

        public string FormatString
        {
            get
            {
                return string.Format("时间：{0} |买入价：{1} |卖出价：{2} |中间价：{3}|美元金：{4} |美元指数：{5} |原油指数:{6} \rn",
                                     this.MsgTime.ToString("yyyy-MM-dd HH:mm:ss"),BuyPrice,SalePrice,MidPrice,DollarPrice,DollarIndex,OilIndex);
            }
        }

    }
}
